{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "71c9e32e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import open3d as o3d\n",
    "import numpy as np\n",
    "import copy\n",
    "import time\n",
    "import os\n",
    "import sys\n",
    "import argparse"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f259dfbb",
   "metadata": {},
   "source": [
    "# 地面点云分割"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "97f5c0a9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "452a2aab",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Load a ply point cloud, print it, and render it\n",
      "PointCloud with 196133 points.\n",
      "[[0.65234375 0.84686458 2.37890625]\n",
      " [0.65234375 0.83984375 2.38430572]\n",
      " [0.66737998 0.83984375 2.37890625]\n",
      " ...\n",
      " [2.00839925 2.39453125 1.88671875]\n",
      " [2.00390625 2.39488506 1.88671875]\n",
      " [2.00390625 2.39453125 1.88793314]]\n"
     ]
    }
   ],
   "source": [
    "print(\"Load a ply point cloud, print it, and render it\")\n",
    "ply_point_cloud = o3d.data.PLYPointCloud()\n",
    "pcd = o3d.io.read_point_cloud(ply_point_cloud.path)\n",
    "print(pcd)\n",
    "print(np.asarray(pcd.points))\n",
    "o3d.visualization.draw_geometries([pcd],\n",
    "                                  zoom=0.3412,\n",
    "                                  front=[0.4257, -0.2125, -0.8795],\n",
    "                                  lookat=[2.6172, 2.0475, 1.532],\n",
    "                                  up=[-0.0694, -0.9768, 0.2024])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fd387384",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Downsample the point cloud with a voxel of 0.05\n"
     ]
    }
   ],
   "source": [
    "print(\"Downsample the point cloud with a voxel of 0.05\")\n",
    "downpcd = pcd.voxel_down_sample(voxel_size=0.05)\n",
    "o3d.visualization.draw_geometries([downpcd],\n",
    "                                  zoom=0.3412,\n",
    "                                  front=[0.4257, -0.2125, -0.8795],\n",
    "                                  lookat=[2.6172, 2.0475, 1.532],\n",
    "                                  up=[-0.0694, -0.9768, 0.2024])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "2c8166d5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Recompute the normal of the downsampled point cloud\n"
     ]
    }
   ],
   "source": [
    "print(\"Recompute the normal of the downsampled point cloud\")\n",
    "downpcd.estimate_normals(\n",
    "    search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))\n",
    "o3d.visualization.draw_geometries([downpcd],\n",
    "                                  zoom=0.3412,\n",
    "                                  front=[0.4257, -0.2125, -0.8795],\n",
    "                                  lookat=[2.6172, 2.0475, 1.532],\n",
    "                                  up=[-0.0694, -0.9768, 0.2024],\n",
    "                                  point_show_normal=True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "70ae24d6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on PointCloud in module open3d.cpu.pybind.geometry object:\n",
      "\n",
      "class PointCloud(Geometry3D)\n",
      " |  PointCloud class. A point cloud consists of point coordinates, and optionally point colors and point normals.\n",
      " |  \n",
      " |  Method resolution order:\n",
      " |      PointCloud\n",
      " |      Geometry3D\n",
      " |      Geometry\n",
      " |      pybind11_builtins.pybind11_object\n",
      " |      builtins.object\n",
      " |  \n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  __add__(...)\n",
      " |      __add__(self: open3d.cpu.pybind.geometry.PointCloud, arg0: open3d.cpu.pybind.geometry.PointCloud) -> open3d.cpu.pybind.geometry.PointCloud\n",
      " |  \n",
      " |  __copy__(...)\n",
      " |      __copy__(self: open3d.cpu.pybind.geometry.PointCloud) -> open3d.cpu.pybind.geometry.PointCloud\n",
      " |  \n",
      " |  __deepcopy__(...)\n",
      " |      __deepcopy__(self: open3d.cpu.pybind.geometry.PointCloud, arg0: dict) -> open3d.cpu.pybind.geometry.PointCloud\n",
      " |  \n",
      " |  __iadd__(...)\n",
      " |      __iadd__(self: open3d.cpu.pybind.geometry.PointCloud, arg0: open3d.cpu.pybind.geometry.PointCloud) -> open3d.cpu.pybind.geometry.PointCloud\n",
      " |  \n",
      " |  __init__(...)\n",
      " |      __init__(*args, **kwargs)\n",
      " |      Overloaded function.\n",
      " |      \n",
      " |      1. __init__(self: open3d.cpu.pybind.geometry.PointCloud) -> None\n",
      " |      \n",
      " |      Default constructor\n",
      " |      \n",
      " |      2. __init__(self: open3d.cpu.pybind.geometry.PointCloud, arg0: open3d.cpu.pybind.geometry.PointCloud) -> None\n",
      " |      \n",
      " |      Copy constructor\n",
      " |      \n",
      " |      3. __init__(self: open3d.cpu.pybind.geometry.PointCloud, points: open3d.cpu.pybind.utility.Vector3dVector) -> None\n",
      " |      \n",
      " |      Create a PointCloud from points\n",
      " |  \n",
      " |  __repr__(...)\n",
      " |      __repr__(self: open3d.cpu.pybind.geometry.PointCloud) -> str\n",
      " |  \n",
      " |  cluster_dbscan(...)\n",
      " |      cluster_dbscan(self, eps, min_points, print_progress=False)\n",
      " |      Cluster PointCloud using the DBSCAN algorithm  Ester et al., 'A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise', 1996. Returns a list of point labels, -1 indicates noise according to the algorithm.\n",
      " |      \n",
      " |      Args:\n",
      " |          eps (float): Density parameter that is used to find neighbouring points.\n",
      " |          min_points (int): Minimum number of points to form a cluster.\n",
      " |          print_progress (bool, optional, default=False): If true the progress is visualized in the console.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.utility.IntVector\n",
      " |  \n",
      " |  compute_convex_hull(...)\n",
      " |      compute_convex_hull(self: open3d.cpu.pybind.geometry.PointCloud, joggle_inputs: bool = False) -> Tuple[open3d::geometry::TriangleMesh, List[int]]\n",
      " |      \n",
      " |      \n",
      " |      Computes the convex hull of the point cloud.\n",
      " |      \n",
      " |      Args:\n",
      " |           joggle_inputs (bool): If True allows the algorithm to add random noise to\n",
      " |                the points to work around degenerate inputs. This adds the 'QJ'\n",
      " |                option to the qhull command.\n",
      " |      \n",
      " |      Returns:\n",
      " |           tuple(open3d.geometry.TriangleMesh, list): The triangle mesh of the convex\n",
      " |           hull and the list of point indices that are part of the convex hull.\n",
      " |  \n",
      " |  compute_mahalanobis_distance(...)\n",
      " |      compute_mahalanobis_distance(self)\n",
      " |      Function to compute the Mahalanobis distance for points in a point cloud. See: https://en.wikipedia.org/wiki/Mahalanobis_distance.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.utility.DoubleVector\n",
      " |  \n",
      " |  compute_mean_and_covariance(...)\n",
      " |      compute_mean_and_covariance(self)\n",
      " |      Function to compute the mean and covariance matrix of a point cloud.\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[numpy.ndarray[numpy.float64[3, 1]], numpy.ndarray[numpy.float64[3, 3]]]\n",
      " |  \n",
      " |  compute_nearest_neighbor_distance(...)\n",
      " |      compute_nearest_neighbor_distance(self)\n",
      " |      Function to compute the distance from a point to its nearest neighbor in the point cloud\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.utility.DoubleVector\n",
      " |  \n",
      " |  compute_point_cloud_distance(...)\n",
      " |      compute_point_cloud_distance(self, target)\n",
      " |      For each point in the source point cloud, compute the distance to the target point cloud.\n",
      " |      \n",
      " |      Args:\n",
      " |          target (open3d.geometry.PointCloud): The target point cloud.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.utility.DoubleVector\n",
      " |  \n",
      " |  crop(...)\n",
      " |      crop(*args, **kwargs)\n",
      " |      Overloaded function.\n",
      " |      \n",
      " |      \n",
      " |      1. crop(self, bounding_box)\n",
      " |          Function to crop input pointcloud into output pointcloud\n",
      " |      \n",
      " |      Args:\n",
      " |          bounding_box (open3d.geometry.AxisAlignedBoundingBox): AxisAlignedBoundingBox to crop points\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |      \n",
      " |      2. crop(self, bounding_box)\n",
      " |          Function to crop input pointcloud into output pointcloud\n",
      " |      \n",
      " |      Args:\n",
      " |          bounding_box (open3d.geometry.OrientedBoundingBox): AxisAlignedBoundingBox to crop points\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  detect_planar_patches(...)\n",
      " |      detect_planar_patches(self, normal_variance_threshold_deg=60, coplanarity_deg=75, outlier_ratio=0.75, min_plane_edge_length=0.0, min_num_points=0, search_param=KDTreeSearchParamKNN with knn = 30)\n",
      " |      Detects planar patches in the point cloud using a robust statistics-based approach.\n",
      " |      \n",
      " |      Returns:\n",
      " |           A list of detected planar patches, represented as\n",
      " |           OrientedBoundingBox objects, with the third column (z) of R indicating\n",
      " |           the planar patch normal vector. The extent in the z direction is\n",
      " |           non-zero so that the OrientedBoundingBox contains the points that\n",
      " |           contribute to the plane detection.\n",
      " |      \n",
      " |      Args:\n",
      " |          normal_variance_threshold_deg (float, optional, default=60)\n",
      " |          coplanarity_deg (float, optional, default=75)\n",
      " |          outlier_ratio (float, optional, default=0.75): Maximum allowable ratio of outliers associated to a plane.\n",
      " |          min_plane_edge_length (float, optional, default=0.0): Minimum edge length of plane's long edge before being rejected.\n",
      " |          min_num_points (int, optional, default=0): Minimum number of points allowable for fitting planes.\n",
      " |          search_param (open3d.geometry.KDTreeSearchParam, optional, default=KDTreeSearchParamKNN with knn = 30): The KDTree search parameters for neighborhood search.\n",
      " |      \n",
      " |      Returns:\n",
      " |          List[open3d.geometry.OrientedBoundingBox]\n",
      " |  \n",
      " |  estimate_covariances(...)\n",
      " |      estimate_covariances(self, search_param=KDTreeSearchParamKNN with knn = 30)\n",
      " |      Function to compute the covariance matrix for each point in the point cloud\n",
      " |      \n",
      " |      Args:\n",
      " |          search_param (open3d.geometry.KDTreeSearchParam, optional, default=KDTreeSearchParamKNN with knn = 30): The KDTree search parameters for neighborhood search.\n",
      " |      \n",
      " |      Returns:\n",
      " |          None\n",
      " |  \n",
      " |  estimate_normals(...)\n",
      " |      estimate_normals(self, search_param=KDTreeSearchParamKNN with knn = 30, fast_normal_computation=True)\n",
      " |      Function to compute the normals of a point cloud. Normals are oriented with respect to the input point cloud if normals exist\n",
      " |      \n",
      " |      Args:\n",
      " |          search_param (open3d.geometry.KDTreeSearchParam, optional, default=KDTreeSearchParamKNN with knn = 30): The KDTree search parameters for neighborhood search.\n",
      " |          fast_normal_computation (bool, optional, default=True): If true, the normal estimation uses a non-iterative method to extract the eigenvector from the covariance matrix. This is faster, but is not as numerical stable.\n",
      " |      \n",
      " |      Returns:\n",
      " |          None\n",
      " |  \n",
      " |  farthest_point_down_sample(...)\n",
      " |      farthest_point_down_sample(self: open3d.cpu.pybind.geometry.PointCloud, num_samples: int) -> open3d.cpu.pybind.geometry.PointCloud\n",
      " |      \n",
      " |      Downsamples input pointcloud into output pointcloud with a set of points has farthest distance. The sample is performed by selecting the farthest point from previous selected points iteratively.\n",
      " |  \n",
      " |  has_colors(...)\n",
      " |      has_colors(self)\n",
      " |      Returns ``True`` if the point cloud contains point colors.\n",
      " |      \n",
      " |      Returns:\n",
      " |          bool\n",
      " |  \n",
      " |  has_covariances(...)\n",
      " |      has_covariances(self: open3d.cpu.pybind.geometry.PointCloud) -> bool\n",
      " |      \n",
      " |      Returns ``True`` if the point cloud contains covariances.\n",
      " |  \n",
      " |  has_normals(...)\n",
      " |      has_normals(self)\n",
      " |      Returns ``True`` if the point cloud contains point normals.\n",
      " |      \n",
      " |      Returns:\n",
      " |          bool\n",
      " |  \n",
      " |  has_points(...)\n",
      " |      has_points(self)\n",
      " |      Returns ``True`` if the point cloud contains points.\n",
      " |      \n",
      " |      Returns:\n",
      " |          bool\n",
      " |  \n",
      " |  hidden_point_removal(...)\n",
      " |      hidden_point_removal(self, camera_location, radius)\n",
      " |      Removes hidden points from a point cloud and returns a mesh of the remaining points. Based on Katz et al. 'Direct Visibility of Point Sets', 2007. Additional information about the choice of radius for noisy point clouds can be found in Mehra et. al. 'Visibility of Noisy Point Cloud Data', 2010.\n",
      " |      \n",
      " |      Args:\n",
      " |          camera_location (numpy.ndarray[numpy.float64[3, 1]]): All points not visible from that location will be removed\n",
      " |          radius (float): The radius of the sperical projection\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[open3d.geometry.TriangleMesh, List[int]]\n",
      " |  \n",
      " |  normalize_normals(...)\n",
      " |      normalize_normals(self)\n",
      " |      Normalize point normals to length 1.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  orient_normals_consistent_tangent_plane(...)\n",
      " |      orient_normals_consistent_tangent_plane(self, k)\n",
      " |      Function to orient the normals with respect to consistent tangent planes\n",
      " |      \n",
      " |      Args:\n",
      " |          k (int): Number of k nearest neighbors used in constructing the Riemannian graph used to propagate normal orientation.\n",
      " |      \n",
      " |      Returns:\n",
      " |          None\n",
      " |  \n",
      " |  orient_normals_to_align_with_direction(...)\n",
      " |      orient_normals_to_align_with_direction(self, orientation_reference=array([0., 0., 1.]))\n",
      " |      Function to orient the normals of a point cloud\n",
      " |      \n",
      " |      Args:\n",
      " |          orientation_reference (numpy.ndarray[numpy.float64[3, 1]], optional, default=array([0., 0., 1.])): Normals are oriented with respect to orientation_reference.\n",
      " |      \n",
      " |      Returns:\n",
      " |          None\n",
      " |  \n",
      " |  orient_normals_towards_camera_location(...)\n",
      " |      orient_normals_towards_camera_location(self, camera_location=array([0., 0., 0.]))\n",
      " |      Function to orient the normals of a point cloud\n",
      " |      \n",
      " |      Args:\n",
      " |          camera_location (numpy.ndarray[numpy.float64[3, 1]], optional, default=array([0., 0., 0.])): Normals are oriented with towards the camera_location.\n",
      " |      \n",
      " |      Returns:\n",
      " |          None\n",
      " |  \n",
      " |  paint_uniform_color(...)\n",
      " |      paint_uniform_color(self, color)\n",
      " |      Assigns each point in the PointCloud the same color.\n",
      " |      \n",
      " |      Args:\n",
      " |          color (numpy.ndarray[numpy.float64[3, 1]]): RGB color for the PointCloud.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  random_down_sample(...)\n",
      " |      random_down_sample(self, sampling_ratio)\n",
      " |      Function to downsample input pointcloud into output pointcloud randomly. The sample is generated by randomly sampling the indexes from the point cloud.\n",
      " |      \n",
      " |      Args:\n",
      " |          sampling_ratio (float): Sampling ratio, the ratio of number of selected points to total number of points[0-1]\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  remove_duplicated_points(...)\n",
      " |      remove_duplicated_points(self)\n",
      " |      Removes duplicated points, i.e., points that have identical coordinates. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing duplicated points.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  remove_non_finite_points(...)\n",
      " |      remove_non_finite_points(self, remove_nan=True, remove_infinite=True)\n",
      " |      Removes all points from the point cloud that have a nan entry, or infinite entries. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing non-finite points.\n",
      " |      \n",
      " |      Args:\n",
      " |          remove_nan (bool, optional, default=True): Remove NaN values from the PointCloud\n",
      " |          remove_infinite (bool, optional, default=True): Remove infinite values from the PointCloud\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  remove_radius_outlier(...)\n",
      " |      remove_radius_outlier(self, nb_points, radius, print_progress=False)\n",
      " |      Removes points that have neighbors less than nb_points in a sphere of a given radius\n",
      " |      \n",
      " |      Args:\n",
      " |          nb_points (int): Number of points within the radius.\n",
      " |          radius (float): Radius of the sphere.\n",
      " |          print_progress (bool, optional, default=False): Set to True to print progress bar.\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[open3d.geometry.PointCloud, List[int]]\n",
      " |  \n",
      " |  remove_statistical_outlier(...)\n",
      " |      remove_statistical_outlier(self, nb_neighbors, std_ratio, print_progress=False)\n",
      " |      Removes points that are further away from their neighbors in average.\n",
      " |      \n",
      " |      Args:\n",
      " |          nb_neighbors (int): Number of neighbors around the target point.\n",
      " |          std_ratio (float): Standard deviation ratio.\n",
      " |          print_progress (bool, optional, default=False): Set to True to print progress bar.\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[open3d.geometry.PointCloud, List[int]]\n",
      " |  \n",
      " |  segment_plane(...)\n",
      " |      segment_plane(self, distance_threshold, ransac_n, num_iterations, probability=0.99999999)\n",
      " |      Segments a plane in the point cloud using the RANSAC algorithm.\n",
      " |      \n",
      " |      Args:\n",
      " |          distance_threshold (float): Max distance a point can be from the plane model, and still be considered an inlier.\n",
      " |          ransac_n (int): Number of initial points to be considered inliers in each iteration.\n",
      " |          num_iterations (int): Number of iterations.\n",
      " |          probability (float, optional, default=0.99999999): Expected probability of finding the optimal plane.\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[numpy.ndarray[numpy.float64[4, 1]], List[int]]\n",
      " |  \n",
      " |  select_by_index(...)\n",
      " |      select_by_index(self, indices, invert=False)\n",
      " |      Function to select points from input pointcloud into output pointcloud.\n",
      " |      \n",
      " |      Args:\n",
      " |          indices (List[int]): Indices of points to be selected.\n",
      " |          invert (bool, optional, default=False): Set to ``True`` to invert the selection of indices.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  uniform_down_sample(...)\n",
      " |      uniform_down_sample(self, every_k_points)\n",
      " |      Function to downsample input pointcloud into output pointcloud uniformly. The sample is performed in the order of the points with the 0-th point always chosen, not at random.\n",
      " |      \n",
      " |      Args:\n",
      " |          every_k_points (int): Sample rate, the selected point indices are [0, k, 2k, ...]\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  voxel_down_sample(...)\n",
      " |      voxel_down_sample(self, voxel_size)\n",
      " |      Function to downsample input pointcloud into output pointcloud with a voxel. Normals and colors are averaged if they exist.\n",
      " |      \n",
      " |      Args:\n",
      " |          voxel_size (float): Voxel size to downsample into.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  voxel_down_sample_and_trace(...)\n",
      " |      voxel_down_sample_and_trace(self, voxel_size, min_bound, max_bound, approximate_class=False)\n",
      " |      Function to downsample using PointCloud.VoxelDownSample. Also records point cloud index before downsampling\n",
      " |      \n",
      " |      Args:\n",
      " |          voxel_size (float): Voxel size to downsample into.\n",
      " |          min_bound (numpy.ndarray[numpy.float64[3, 1]]): Minimum coordinate of voxel boundaries\n",
      " |          max_bound (numpy.ndarray[numpy.float64[3, 1]]): Maximum coordinate of voxel boundaries\n",
      " |          approximate_class (bool, optional, default=False)\n",
      " |      \n",
      " |      Returns:\n",
      " |          Tuple[open3d.geometry.PointCloud, numpy.ndarray[numpy.int32[m, n]], List[open3d.utility.IntVector]]\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods defined here:\n",
      " |  \n",
      " |  create_from_depth_image(...) from builtins.PyCapsule\n",
      " |      create_from_depth_image(depth, intrinsic, extrinsic=(with default value), depth_scale=1000.0, depth_trunc=1000.0, stride=1, project_valid_depth_only=True)\n",
      " |      Factory function to create a pointcloud from a depth image and a\n",
      " |      camera. Given depth value d at (u, v) image coordinate, the corresponding 3d point is:\n",
      " |      \n",
      " |          - z = d / depth_scale\n",
      " |          - x = (u - cx) * z / fx\n",
      " |          - y = (v - cy) * z / fy\n",
      " |      \n",
      " |      Args:\n",
      " |          depth (open3d.geometry.Image): The input depth image can be either a float image, or a uint16_t image.\n",
      " |          intrinsic (open3d.camera.PinholeCameraIntrinsic): Intrinsic parameters of the camera.\n",
      " |          extrinsic (numpy.ndarray[numpy.float64[4, 4]], optional) Default value:\n",
      " |      \n",
      " |              array([[1., 0., 0., 0.],\n",
      " |              [0., 1., 0., 0.],\n",
      " |              [0., 0., 1., 0.],\n",
      " |              [0., 0., 0., 1.]])\n",
      " |          depth_scale (float, optional, default=1000.0): The depth is scaled by 1 / depth_scale.\n",
      " |          depth_trunc (float, optional, default=1000.0): Truncated at depth_trunc distance.\n",
      " |          stride (int, optional, default=1): Sampling factor to support coarse point cloud extraction.\n",
      " |          project_valid_depth_only (bool, optional, default=True)\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  create_from_rgbd_image(...) from builtins.PyCapsule\n",
      " |      create_from_rgbd_image(image, intrinsic, extrinsic=(with default value), project_valid_depth_only=True)\n",
      " |      Factory function to create a pointcloud from an RGB-D image and a camera. Given depth value d at (u, v) image coordinate, the corresponding 3d point is:\n",
      " |      \n",
      " |          - z = d / depth_scale\n",
      " |          - x = (u - cx) * z / fx\n",
      " |          - y = (v - cy) * z / fy\n",
      " |      \n",
      " |      Args:\n",
      " |          image (open3d.geometry.RGBDImage): The input image.\n",
      " |          intrinsic (open3d.camera.PinholeCameraIntrinsic): Intrinsic parameters of the camera.\n",
      " |          extrinsic (numpy.ndarray[numpy.float64[4, 4]], optional) Default value:\n",
      " |      \n",
      " |              array([[1., 0., 0., 0.],\n",
      " |              [0., 1., 0., 0.],\n",
      " |              [0., 0., 1., 0.],\n",
      " |              [0., 0., 0., 1.]])\n",
      " |          project_valid_depth_only (bool, optional, default=True)\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.PointCloud\n",
      " |  \n",
      " |  estimate_point_covariances(...) from builtins.PyCapsule\n",
      " |      estimate_point_covariances(input, search_param=KDTreeSearchParamKNN with knn = 30)\n",
      " |      Static function to compute the covariance matrix for each point in the given point cloud, doesn't change the input\n",
      " |      \n",
      " |      Args:\n",
      " |          input (open3d.geometry.PointCloud): The input point cloud.\n",
      " |          search_param (open3d.geometry.KDTreeSearchParam, optional, default=KDTreeSearchParamKNN with knn = 30): The KDTree search parameters for neighborhood search.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.utility.Matrix3dVector\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors defined here:\n",
      " |  \n",
      " |  colors\n",
      " |      ``float64`` array of shape ``(num_points, 3)``, range ``[0, 1]`` , use ``numpy.asarray()`` to access data: RGB colors of points.\n",
      " |  \n",
      " |  covariances\n",
      " |      ``float64`` array of shape ``(num_points, 3, 3)``, use ``numpy.asarray()`` to access data: Points covariances.\n",
      " |  \n",
      " |  normals\n",
      " |      ``float64`` array of shape ``(num_points, 3)``, use ``numpy.asarray()`` to access data: Points normals.\n",
      " |  \n",
      " |  points\n",
      " |      ``float64`` array of shape ``(num_points, 3)``, use ``numpy.asarray()`` to access data: Points coordinates.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from Geometry3D:\n",
      " |  \n",
      " |  get_axis_aligned_bounding_box(...)\n",
      " |      get_axis_aligned_bounding_box(self)\n",
      " |      Returns an axis-aligned bounding box of the geometry.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.AxisAlignedBoundingBox\n",
      " |  \n",
      " |  get_center(...)\n",
      " |      get_center(self)\n",
      " |      Returns the center of the geometry coordinates.\n",
      " |      \n",
      " |      Returns:\n",
      " |          numpy.ndarray[numpy.float64[3, 1]]\n",
      " |  \n",
      " |  get_max_bound(...)\n",
      " |      get_max_bound(self)\n",
      " |      Returns max bounds for geometry coordinates.\n",
      " |      \n",
      " |      Returns:\n",
      " |          numpy.ndarray[numpy.float64[3, 1]]\n",
      " |  \n",
      " |  get_min_bound(...)\n",
      " |      get_min_bound(self)\n",
      " |      Returns min bounds for geometry coordinates.\n",
      " |      \n",
      " |      Returns:\n",
      " |          numpy.ndarray[numpy.float64[3, 1]]\n",
      " |  \n",
      " |  get_minimal_oriented_bounding_box(...)\n",
      " |      get_minimal_oriented_bounding_box(self: open3d.cpu.pybind.geometry.Geometry3D, robust: bool = False) -> open3d::geometry::OrientedBoundingBox\n",
      " |      \n",
      " |      \n",
      " |      Returns the minimal oriented bounding box for the geometry.\n",
      " |      \n",
      " |      Creates the oriented bounding box with the smallest volume.\n",
      " |      The algorithm makes use of the fact that at least one edge of\n",
      " |      the convex hull must be collinear with an edge of the minimum\n",
      " |      bounding box: for each triangle in the convex hull, calculate\n",
      " |      the minimal axis aligned box in the frame of that triangle.\n",
      " |      at the end, return the box with the smallest volume\n",
      " |      \n",
      " |      Args:\n",
      " |           robust (bool): If set to true uses a more robust method which works in\n",
      " |                degenerate cases but introduces noise to the points coordinates.\n",
      " |      \n",
      " |      Returns:\n",
      " |           open3d.geometry.OrientedBoundingBox: The oriented bounding box. The\n",
      " |           bounding box is oriented such that its volume is minimized.\n",
      " |  \n",
      " |  get_oriented_bounding_box(...)\n",
      " |      get_oriented_bounding_box(self: open3d.cpu.pybind.geometry.Geometry3D, robust: bool = False) -> open3d::geometry::OrientedBoundingBox\n",
      " |      \n",
      " |      \n",
      " |      Returns the oriented bounding box for the geometry.\n",
      " |      \n",
      " |      Computes the oriented bounding box based on the PCA of the convex hull.\n",
      " |      The returned bounding box is an approximation to the minimal bounding box.\n",
      " |      \n",
      " |      Args:\n",
      " |           robust (bool): If set to true uses a more robust method which works in \n",
      " |                degenerate cases but introduces noise to the points coordinates.\n",
      " |      \n",
      " |      Returns:\n",
      " |           open3d.geometry.OrientedBoundingBox: The oriented bounding box. The\n",
      " |           bounding box is oriented such that the axes are ordered with respect to\n",
      " |           the principal components.\n",
      " |  \n",
      " |  rotate(...)\n",
      " |      rotate(*args, **kwargs)\n",
      " |      Overloaded function.\n",
      " |      \n",
      " |      \n",
      " |      1. rotate(self, R)\n",
      " |          Apply rotation to the geometry coordinates and normals.\n",
      " |      \n",
      " |      Args:\n",
      " |          R (numpy.ndarray[numpy.float64[3, 3]]): The rotation matrix\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |      \n",
      " |      2. rotate(self, R, center)\n",
      " |          Apply rotation to the geometry coordinates and normals.\n",
      " |      \n",
      " |      Args:\n",
      " |          R (numpy.ndarray[numpy.float64[3, 3]]): The rotation matrix\n",
      " |          center (numpy.ndarray[numpy.float64[3, 1]]): Rotation center used for transformation.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |  \n",
      " |  scale(...)\n",
      " |      scale(*args, **kwargs)\n",
      " |      Overloaded function.\n",
      " |      \n",
      " |      \n",
      " |      1. scale(self, scale, center)\n",
      " |          Apply scaling to the geometry coordinates.\n",
      " |      \n",
      " |      Args:\n",
      " |          scale (float): The scale parameter that is multiplied to the points/vertices of the geometry.\n",
      " |          center (numpy.ndarray[numpy.float64[3, 1]]): Scale center used for transformation.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |      \n",
      " |      2. scale(self, scale, center)\n",
      " |          Apply scaling to the geometry coordinates.\n",
      " |      \n",
      " |      Args:\n",
      " |          scale (float): The scale parameter that is multiplied to the points/vertices of the geometry.\n",
      " |          center (numpy.ndarray[numpy.float64[3, 1]]): Scale center used for transformation.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |  \n",
      " |  transform(...)\n",
      " |      transform(self, arg0)\n",
      " |      Apply transformation (4x4 matrix) to the geometry coordinates.\n",
      " |      \n",
      " |      Args:\n",
      " |          arg0 (numpy.ndarray[numpy.float64[4, 4]])\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |  \n",
      " |  translate(...)\n",
      " |      translate(self, translation, relative=True)\n",
      " |      Apply translation to the geometry coordinates.\n",
      " |      \n",
      " |      Args:\n",
      " |          translation (numpy.ndarray[numpy.float64[3, 1]]): A 3D vector to transform the geometry\n",
      " |          relative (bool, optional, default=True): If true, the translation vector is directly added to the geometry coordinates. Otherwise, the center is moved to the translation vector.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry3D\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods inherited from Geometry3D:\n",
      " |  \n",
      " |  get_rotation_matrix_from_axis_angle(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_axis_angle(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_quaternion(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_quaternion(rotation: numpy.ndarray[numpy.float64[4, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_xyz(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_xyz(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_xzy(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_xzy(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_yxz(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_yxz(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_yzx(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_yzx(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_zxy(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_zxy(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  get_rotation_matrix_from_zyx(...) from builtins.PyCapsule\n",
      " |      get_rotation_matrix_from_zyx(rotation: numpy.ndarray[numpy.float64[3, 1]]) -> numpy.ndarray[numpy.float64[3, 3]]\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from Geometry:\n",
      " |  \n",
      " |  clear(...)\n",
      " |      clear(self)\n",
      " |      Clear all elements in the geometry.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry\n",
      " |  \n",
      " |  dimension(...)\n",
      " |      dimension(self)\n",
      " |      Returns whether the geometry is 2D or 3D.\n",
      " |      \n",
      " |      Returns:\n",
      " |          int\n",
      " |  \n",
      " |  get_geometry_type(...)\n",
      " |      get_geometry_type(self)\n",
      " |      Returns one of registered geometry types.\n",
      " |      \n",
      " |      Returns:\n",
      " |          open3d.geometry.Geometry.GeometryType\n",
      " |  \n",
      " |  is_empty(...)\n",
      " |      is_empty(self)\n",
      " |      Returns ``True`` iff the geometry is empty.\n",
      " |      \n",
      " |      Returns:\n",
      " |          bool\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from Geometry:\n",
      " |  \n",
      " |  HalfEdgeTriangleMesh = <Type.HalfEdgeTriangleMesh: 7>\n",
      " |  \n",
      " |  Image = <Type.Image: 8>\n",
      " |  \n",
      " |  LineSet = <Type.LineSet: 4>\n",
      " |  \n",
      " |  PointCloud = <Type.PointCloud: 1>\n",
      " |  \n",
      " |  RGBDImage = <Type.RGBDImage: 9>\n",
      " |  \n",
      " |  TetraMesh = <Type.TetraMesh: 10>\n",
      " |  \n",
      " |  TriangleMesh = <Type.TriangleMesh: 6>\n",
      " |  \n",
      " |  Type = <class 'open3d.cpu.pybind.geometry.Geometry.Type'>\n",
      " |      Enum class for Geometry types.\n",
      " |  \n",
      " |  Unspecified = <Type.Unspecified: 0>\n",
      " |  \n",
      " |  VoxelGrid = <Type.VoxelGrid: 2>\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods inherited from pybind11_builtins.pybind11_object:\n",
      " |  \n",
      " |  __new__(*args, **kwargs) from pybind11_builtins.pybind11_type\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(pcd)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fd495526",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
